package com.nf.mvc.support.converter;

import com.nf.mvc.support.WebTypeConverter;

import java.text.SimpleDateFormat;
import java.util.Date;

import static com.nf.mvc.support.Constants.Date.DATETIME_PATTERN;

public class DateTypeConverter implements WebTypeConverter<Date> {
    @Override
    public Date convert(String value) throws Exception {
        return new SimpleDateFormat(DATETIME_PATTERN).parse(value);
    }
}
